<include file="Public:header"/>
<if condition="$place.type eq 1">
 <script type="text/javascript" charset="utf-8">window.UEDITOR_HOME_URL= "__PUBLIC__/ueditor/";</script>
 <script type="text/javascript" charset="utf-8" src="__PUBLIC__/ueditor/editor_config.js"></script>
 <script type="text/javascript" charset="utf-8" src="__PUBLIC__/ueditor/editor_all.js"></script>
 </if>
 <script type="text/javascript" src="__APP__/statics/time/lhgcalendar.min.js"></script>
<script type="text/javascript">
	$(function(){
		$('[name=end_time]').calendar();
	});
</script>
<style>
body{font-size:15px;}
</style>
<form method="POST" enctype="multipart/form-data" action="__URL__/insert">
<table border="1" width="100%" style="border-collapse: collapse" bordercolor="#CCCCCC">
	<tr height="30">
		<td align="right">广告位置：</td>
		<td>{$place.place_name}<input type="text" name="place_tag" value="{$place.place_tag}" style="display:none"></td>
	</tr>
	<tr height="30">
		<td align="right">广告类型：</td>
		<td>
<switch name="place.type">
    <case value="1">文字</case>
    <case value="2">图片</case>
	<case value="3">flash</case>
	<case value="4">代码</case>
</switch>
        <input type="text" name="type" value="{$place.type}" style="display:none">
        </td>
	</tr>
	<tr height="30">
		<td align="right">内容：</td>
		<td>
<switch name="place.type">
    <case value="1">
	     <textarea name="content" id='word'></textarea>
    </case>
    <case value="2">
	     <input type="button" id="add_more" value="再加一个">
	     <div id="content">链接：<input type="text" name="url" size="30" value="http://">—<input type="file" name="pic[]" size="20"></div><br>
		 是否新窗口打开<input type="checkbox" name="new_win">
	</case>
	<case value="3">
	     <div id="content">链接：<input type="text" name="url" size="30" value="http://">—<input type="file" name="flash[]" size="20"></div>
	</case>
	<case value="4"><textarea name="content" cols="60" rows="10"></textarea></case>
</switch>
		</td>
	</tr>
	<tr height="30">
		<td align="right">宽x高：</td>
		<td><input type="text" name="chang" size="4">x<input type="text" name="kuan" size="4"></td>
	</tr>
	<tr height="30">
		<td align="right">显示截至时间：</td>
		<td><input type="text" name="end_time" size="20" value="0">为0则一直显示</td>
	</tr>
	<tr height="30">
		<td align="right">排序：</td>
		<td><input type="text" name="sort" size="9" value="0"></td>
	</tr>
	<tr height="30">
		<td align="right">是否显示：</td>
		<td>
		  <input type="radio" value="true" checked name="is_show">是
		  <input type="radio" value="false" name="is_show">否
		</td>
	</tr>
</table>
<br><br>
<div id="save"><input type="submit" style="padding:2px;" value="添加广告"></div>
</form>

<script>
$("#add_more").click(function(){
     $('<dt>链接：<input type="text" name="url" size="30" value="http://">—<input type="file" name="pic[]" size="20"><a href="javascript:;" name="del">移除</a></dt>').appendTo($("#content"));
	 remove();
})

function remove(){
      $("a[name=del]").unbind().click(function () {
          $(this).parent().remove();
	  })
}
</script>
<if condition="$place.type eq 1">
<SCRIPT type="text/javascript">  
    var editor = new UE.ui.Editor({
    initialFrameHeight:180
	,initialFrameWidth:600
	,toolbars:[
            ['fullscreen', 'source', '|', 'undo', 'redo', '|',
                'bold', 'italic', 'underline','|', 'forecolor', 'backcolor',  '|',
                'fontfamily', 'fontsize', '|',
                'justifyleft', 'justifycenter', 'justifyright', 'justifyjustify','link', 'unlink']
        ]
}); 
    editor.render("word");  
</SCRIPT>
</if>